#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}


rm -f ~/ulauncher.deb
wget -O ~/ulauncher.deb 'https://github.com/Ulauncher/Ulauncher/releases/download/5.14.0/ulauncher_5.14.0_all.deb' || error 'Failed to download ulauncher.deb!'

"${DIRECTORY}/pkg-install" "gir1.2-appindicator3-0.1 python3-distutils-extra python3-levenshtein python3-websocket $HOME/ulauncher.deb" "$(dirname "$0")" || error "Failed to install ulauncher.deb and dependencies!"  

rm -f ~/ulauncher.deb
